
#include <machine/asm.h>
#if defined(LIBC_SCCS)
	RCSID("$NetBSD: byte_swap_2.S,v 1.4 2014/05/23 03:17:31 uebayasi Exp $")
#endif

#if defined(_KERNEL) || defined(_STANDALONE)
_ENTRY(_C_LABEL(bswap16))
#else /* defined(_KERNEL) || defined(_STANDALONE) */
_ENTRY(_C_LABEL(__bswap16))
#endif /* defined(_KERNEL) || defined(_STANDALONE) */
_ENTRY(_C_LABEL(ntohs))
_ENTRY(_C_LABEL(htons))
_PROF_PROLOGUE
	movzwl	4(%esp),%eax
	xchgb	%al, %ah
	ret
#if defined(_KERNEL) || defined(_STANDALONE)
END(_C_LABEL(bswap16))
#else /* defined(_KERNEL) || defined(_STANDALONE) */
END(_C_LABEL(__bswap16))
#endif /* defined(_KERNEL) || defined(_STANDALONE) */
END(_C_LABEL(ntohs))
END(_C_LABEL(htons))
